import mmcorej.CMMCore;

import org.micromanager.MMStudioMainFrame;

import ij.IJ;
import ij.plugin.PlugIn;
import ij.umasuo.MyConstants;
import ij.umasuo.camera.CameraCtrInterface;


/**
 * this the class that connect to the camera
 * @author storm
 *
 */
public class MMFramePlugin implements PlugIn, CameraCtrInterface{
	public static CMMCore core = null;
	MMStudioMainFrame gui ;
	private boolean initCore(){
		gui = MMStudioMainFrame.getInstance();
		if(gui == null){return false;}
		core = gui.getCore();
		if(core == null){return false;}
		if(gui.isLiveModeOn()){
			gui.enableLiveMode(false);
		}
		
		return true;
	}
	public MMFramePlugin(){
		IJ.log("in the mmframeplugin constructor....");
		initCore();
		MyConstants.cameraCtr = this;
	}
	@Override
	public void run(String arg) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void showWin() {
		if(gui!=null){
			gui.show();
		}
	}

	@Override
	public void hideWin() {
		if(gui!=null){
			gui.hide();
		}
	}

}
